package org.tongdao.yulong.withanno;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Map;
import java.util.function.BiConsumer;

/**
 * @Description: TODO
 * @author: 殷玉龙
 * @date: 2020年09月27日 6:15 下午
 */
public class WithAnnoApplication {
  public static void main(String[] args) {
    ApplicationContext ctx = new ClassPathXmlApplicationContext("basic_dl/quickstart-withanno.xml");
    Map<String, Object> beansWithAnnotation = ctx.getBeansWithAnnotation(Color.class);
    beansWithAnnotation.forEach(new BiConsumer<String, Object>() {
      @Override
      public void accept(String s, Object o) {
        System.out.println(s + ":" +o);
      }
    });
  }
}
